{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <form action="{:request()->url()}" class="layui-form" method="post">
            <div class="layui-form-item">
                <label class="layui-form-label">时间</label>
                <div class="layui-input-inline">
                    <input type="text" name="datetime" id="test14" value="{if isset($data)}{:date('Y-m-d H:i:s',$data.datetime)}{else}{:date('Y-m-d H:i:s',time())}{/if}" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">报销人</label>
                <div class="layui-input-inline">
                    <select name="bxuser">
                        {foreach name=":model('user')->where(['status'=>'1'])->select()" item="r"}
                        <option value="{$r.id}" {if condition="isset($data) and ($data.bxuser eq $r.id)"} selected="selected"{/if}>{$r.realname}</option>
                        {/foreach}
                    </select>
                </div>
                <div class="layui-input-inline">
                    <a href="{:url('user/staff/add')}" data-width="440px" data-height="420px" class="layui-btn layui-bg-cyan layui-btn-sm ajax-iframe"><i class="fa fa-plus-circle"></i> 新增报销人</a>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">部门</label>
                <div class="layui-input-inline">
                    <select name="department">
                        {foreach name=":model('hook')->where(['group'=>'1','status'=>'1'])->select()" item="r"}
                        <option value="{$r.id}" {if condition="isset($data) and ($data.department eq $r.id)"} selected="selected"{/if}>{$r.name}</option>
                        {/foreach}
                    </select>
                </div>
                <div class="layui-input-inline">
                    <a href="{:url('user/hook/add',['group'=>'1'])}" data-width="430px" data-height="205px" class="layui-btn layui-bg-cyan layui-btn-sm ajax-iframe"><i class="fa fa-plus-circle"></i> 新增部门</a>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">类目</label>
                <div class="layui-input-inline">
                    <select name="category">
                        {foreach name=":model('hook')->where(['group'=>'2','status'=>'1'])->select()" item="r"}
                        <option value="{$r.id}" {if condition="isset($data) and ($data.category eq $r.id)"} selected="selected"{/if}>{$r.name}</option>
                        {/foreach}
                    </select>
                </div>
                <div class="layui-input-inline">
                    <a href="{:url('user/hook/add',['group'=>'2'])}" data-width="430px" data-height="205px" class="layui-btn layui-bg-cyan layui-btn-sm ajax-iframe"><i class="fa fa-plus-circle"></i> 新增类别</a>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">凭证号</label>
                <div class="layui-input-inline">
                    <input type="text" name="voucher" value="{$data.voucher|default=''}" autocomplete="off" placeholder="凭证号" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">线下保存凭证号</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">费用</label>
                <div class="layui-input-inline" style="width:90px;">
                    <select name="type">
                        <option value="1">收入</option>
                        <option value="2">支出</option>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <input type="number" name="price" value="{$data.price|default=''}" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">元</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">备注信息</label>
                <div class="layui-input-block">
                    <textarea name="remark" class="layui-textarea">{$data.remark|default=''}</textarea>
                </div>
            </div>
            
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" id="layuiadmin-app-form-submit" lay-filter="i" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>


{/block}
{block name="js"}
<script type="text/javascript">
    laydate.render({
        elem: '#test14'
        ,type: 'datetime'
    });
    
</script>
<script type="text/javascript" src="/static/city-picker/assets/data.js"></script>
<script type="text/javascript">
    var defaults = {
        s1: 'province',
        s2: 'city',
        s3: 'area',
        v1: '{$data.province|default=""}',
        v2: '{$data.city|default=""}',
        v3: '{$data.area|default=""}'
    };

</script>
<script type="text/javascript" src="/static/city-picker/assets/province.js"></script>

{/block}
